package com.zhoug.demo.push;

import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.widget.TextView;

import com.zhoug.push.core.PushMessage;

/**
 * @description: 类的简要描述
 * @author: 35574
 * @date: 2025/11/4 14:22
 */
public class NotificationDispatchActivity extends MyBaseActivity {
    private static final String TAG = ">>>NotificationDispatch";
    private PushMessage mMessage;
    private TextView mTvMessage;

    @Override
    protected int getLayoutResId() {
        return R.layout.activity_notifycation_dispatch;
    }

    @Override
    protected void findViews() {

        mTvMessage = findViewById(R.id.tv_message);
    }

    @Override
    protected void onCreate1(Bundle savedInstanceState) {
        Intent intent = getIntent();
        if (intent != null) {
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
                mMessage = intent.getParcelableExtra("message", PushMessage.class);
            } else {
                mMessage = intent.getParcelableExtra("message");
            }
        }

        if (mMessage != null) {
            mTvMessage.setText(mMessage.getVendor() + "\n" + mMessage.getContent());
        } else {
            mTvMessage.setText("message is null");
        }
    }

}
